package com.controller;

import com.entity.*;
import com.service.PurGoodsService;
import com.service.PurOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/purgoods")
public class PurGoodsController {
    @Autowired
    private PurGoodsService purGoodsService;
    @RequestMapping("/getGoodsList/{pageIndex}/{pageSize}")
    public Result getGoodsList(
          @PathVariable("pageIndex") Integer pageIndex,
          @PathVariable("pageSize") Integer pageSize,
          @RequestBody PurGoods purGoods
    ){
        PageBean<PurGoods> pageBean = purGoodsService.getGoodsList(pageIndex, pageSize, purGoods);
        return Result.ok(pageBean);
    }
    @RequestMapping("/findAll")
    public Result<List<PurGoods>> findAll(){
        return Result.ok(purGoodsService.findAll());
    }


}
